Ext.define('Ext.progs.models.Main', {
	extend: 'Ext.data.Model',
	fields: [
		'id', {name: 'date', type: 'date', dateFormat: 'timestamp'}, 'client', 
		'address', 'model', 'disign', 'warranty', 'ttn', 'schet', 'code', 
		'comment', 'sn', 'in'
	]
});

Ext.define('Ext.progs.storages.Main', {
	extend: 'Ext.data.Store',
	model: 'Ext.progs.models.Main',
	autoLoad: true,
	autoSync: true,
	proxy: {
		type: 'ajax',
		timeout: 3600000,
		url : '/frigoglass/src/server/get_main.py?qid=0',
		api: {
			update: '/frigoglass/src/server/update_main.py',
		},
		reader: {
			type: 'json',
			root: 'main',
			totalProperty: 'totalCount'
		},
		writer: {
			type: 'json',
			allowSingle: true,
			writeAllFields: false,
			successProperty: 'success',
			root: 'data'
		}
	}
});

qid = 0;

var main_store = new Ext.progs.storages.Main();
var main_store2 = new Ext.progs.storages.Main();